<template>
  <el-container class="home-container">
    <el-header>
      <div>
        <img src="" alt="" height="50px">
        <span>ACG动漫网后台管理系统</span>
      </div>
      <el-button type="info" @click="logout">退出</el-button>
    </el-header>
    <!-- 页面主体区域 -->
    <el-container>
      <!-- 侧边栏 -->
      <el-aside width="200px">
        <nav>
          <div
            v-for="(item,index) in meaulist"
            :key="index"
            class="meau-item"
            @click="pushRouter(item.id)"
          >
            {{ item.aside }}
          </div>
        </nav>
      </el-aside>
      <!-- 右侧内容主体 -->
      <el-main>
        <router-view />
      </el-main>
    </el-container>
  </el-container>
</template>


<script>
import { ElContainer,ElHeader,ElMain,ElButton,ElAside } from 'element-plus'
export default {
  components: { ElContainer,ElHeader,ElMain,ElButton,ElAside },
  data() {
    return {
      meaulist:[
        { id: 1, aside:'动漫排行榜管理' },
        { id: 2, aside:'游戏排行榜管理' },
        { id: 3, aside:'会员购商品管理' },
        { id: 4, aside:'物流管理' }
      ]
    }
  },
  methods: {
    pushRouter(id) {
      if(id === 1) {
        this.$router.push({ path:'/managercartonrank' })
      } else if(id === 2) {
        this.$router.push({ path:'/managergamerank' })
      } else if(id === 3) {
        this.$router.push({ path:'/managershop' })
      } else if(id === 4) {
        this.$router.push({ path:'/managershoprecord' })
      }
    }
  }
}
</script>


<style lang="scss" scoped>
.home-container{
    height: 100%;
}
 .el-header{
     background-color: #373d41;
     display: flex; //设置显示为flex布局
     justify-content: space-between;//设置为flex左右布局
     padding-left: 0;//左内边距为0（Logo贴左边）
     align-items: center;//元素上下居中（防止右边按钮贴上下边）
     color: #fff;
     font-size: 20px;
     > div {//内嵌的div样式
         align-items: center;//Logo和文字上下居中
         span {
             margin-left: 15px;//文字左侧设置间距，防止与Logo紧贴
         }
     }
 }
  .el-aside{
     background-color: #333744;
     color: #fff;
     nav {
       display: flex;
       flex-direction: column;
       .meau-item {
         height: 80px;
         line-height: 80px;
         padding-left: 20px;
         cursor: pointer;
       }
       .meau-item:hover {
         background-color: #000;
       }
     }
 }
  .el-main{
     background-color: #eaedf1;
 }
</style>
